require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Hua
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

    # Do not swallow errors in after_commit/after_rollback callbacks.
    config.active_record.raise_in_transactional_callbacks = true
    #自动加载静态资源文件路径
    #
    #config.autoload_paths << "#{Rails.root}/lib"

    #自定义添加静态资源搜索路径
    #config.assets.paths << Rails.root.join("lib",'vor')
    #由于启用了assets pipeline,视图静态资源相关的帮助方法默认伺服的是app/assets下的文件
    #也就是说，如果放在lib/assets 或 vendor/assets 下，将无法伺服到，此时就需要使用下面的属性将需要伺服的文件单独加入到编译路径中。
    #
    config.assets.precompile+= %w( manager/manager.js about.coffee posts.coffee  )

    config.assets.precompile+= %w( manager/index.css )
    config.assets.precompile+= %w( posts/page_main_layout/index.css )
    config.assets.precompile+= %w( posts.scss )
    #类似这样的可以使用
    # <%= stylesheet_link_tag params[:controller] %>
    config.assets.precompile+= %w( about.scss )
    #由于是清单文件，所以只能
    #<%= stylesheet_link_tag 'manager/users_bm' %>
    config.assets.precompile+= %w( manager/users_bm/index.css )
    config.assets.precompile+= %w( admin/authorize_site/index.css )

  end
end
